<?php

class ImageLink extends CActiveRecord
{
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

	public function rules()
	{
		return array(
			array('object_id, object_type, image_id, type', 'safe'),
		);
	}

    public function tableName()
    {
        return '{{image_links}}';
    }

	public function relations()
	{
		return array(
			'image' => array(self::HAS_ONE, 'Image', array('image_id' => 'image_id')),
//			'addition_image' => array(self::HAS_ONE, 'Image', 'image_id'),
		);
	}
}
?>